
# EasyDeepLearningInferenceLive_V4L2_Qt

This code sample sample shows how to use Open eVision in a live application to do inspection with a Deep
Learning tool. It is mostly aimed at being a demonstration of Open eVision on embedded platforms like smart
cameras.

This code sample is available in many different variants. The one you are currently reading is using:

* A desktop application using Qt.
* The V4L2 library (used on Nvidia Jetson platforms).

Please note that the current sample was distributed along with other similar samples providing other connectivity
possibilities. Please consult those other samples if the current one is not appropriate for your use case.

## Dependencies

### Open eVision

This sample depends on Open eVision. Please install it in a version suitable for your platform.

All Open eVision releases are available at this address: https://www.euresys.com/en/Support/Download-area

### GCC

This sample necessitates a GCC building solution able to compile C++ 17.

To install it on a Debian-based operating system use this command:

```
sudo apt install build-essential
```

### CMake

This sample necessitates CMake >= 3.1.0 .

To install it on a Debian-based operating system use this command:

```
sudo apt install cmake
```

### Qt

This sample necessitates Qt 5.

To install the necessary packages on a Raspberry Pi use the following command:

```
sudo apt install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
```

To install those tools on a Nvidia Jetson system use this command instead:

```
sudo apt install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
```
### V4L2

This sample necessitates the V4L2 library.
It was tested with version "1.14.2-1" of v4l-utils on a Jetson Linux R32.7.3 OS.

To install that library on a Nvidia Jetson computer use the following command:

```
sudo apt install v4l-utils
```


## Using a deep Learning tool

This project can open any Deep Learning tool (EasyClassify, EasySegment, EasyLocate) exported from Deep Learning Studio.

In the Deep Learning Additional Resources, you can find `model.edltool` files for each dataset that can be used with this sample.


## Compiling this sample

Use the following commands in order to compile your project:

```bash
mkdir build
cd build
cmake ..
make -j2
```

Alternatively, you could build the sample by using Qt Creator. To do so, open the CMakeLists.txt file in Qt Creator.

## Using this sample

When launched this sample will display a camera output showing the images produced by the camera. The result of the
deep learning inspection is displayed in the image according to the type of tool.

## Known Issues

* We faced an issue with V4L2 on a jetson nano with a raspberry pi camera. The V4L2Qt sample did not show any image
  and "select timeout" was printed on the standard output. The version of the jetson library was "# R32 (release),
  REVISION: 6.1, GCID: 27863751, BOARD: t210ref, EABI: aarch64, DATE: Mon Jul 26 19:20:30 UTC 2021" (output of
  "cat /etc/nv_tegra_release"). The solution to this problem was to update libv412_nvargus.so as indicated in
  [the following post](https://forums.developer.nvidia.com/t/libv4l2-nvargus-so-source-code/168303/19).
